// Grid Styles
.slim-grid {
  font-family: $slimgrid-font-family;
  font-size: $slimgrid-font-size;
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  color: $slimgrid-font-color;
  border-top: 1px solid $slimgrid-border-color;
  border-right: 1px solid $slimgrid-border-color;
  border-left: 1px solid $slimgrid-border-color;
  border-bottom: 1px solid $slimgrid-border-color;
  border-top-left-radius: $slimgrid-border-radius;
  border-top-right-radius: $slimgrid-border-radius;

  div {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
  }

  &.bottom-rounded {
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
  }

  .text-center {
    text-align: center;
  }
}

.slick-viewport {
  background-color: $slimgrid-bg-color;

  .grid-canvas {
    position: relative;
    outline: 0;
  }
}

.slick-range-decorator {
  z-index: 9999;
  cursor: cell;
  border: $slimgrid-range-border;
}

.slick-row {
  &.ui-widget-content {
    position: absolute;
    border: 0px;
    width: 100%;
  }

  &.ui-state-active {
    position: absolute;
    border: 0px;
    width: 100%;
    background: $slimgrid-cell-selected-bg-color;
  }

  .selected {
    z-index: 10;
    background-color: $slimgrid-cell-selected-bg-color;
    color: $slimgrid-cell-selected-color;
  }
}

.slick-group {
  border-bottom: 2px solid $slimgrid-border-color;
  background-color: $slimgrid-header-bg-color;

  .slick-cell {
    text-align: left !important;
    padding-left: 4px;
    padding-right: 4px;
  }
}

.slick-group-toggle {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;

  &.expanded {
    background: url(../assets/images/collapse.gif) no-repeat center center;
  }

  &.collapsed {
    background: url(../assets/images/expand.gif) no-repeat center center;
  }
}

.slick-group-totals {
  color: $slimgrid-font-color;
  background: $slimgrid-bg-color;
}

.slick-cell {
  position: absolute;
  border-right: 1px solid $slimgrid-border-color;
  border-left: 1px solid transparent;
  border-top: 1px solid transparent;
  border-bottom: 1px solid $slimgrid-border-color;
  overflow: hidden;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis;
  vertical-align: middle;
  z-index: 1;
  margin: 0;
  white-space: nowrap;
  padding: 2px 1px 0px 1px;
  cursor: default;
  
  img {
    vertical-align: initial;
  }

  &.selected {
    background-color: $slimgrid-cell-selected-bg-color;
    color: $slimgrid-cell-selected-color;
    span a {
      color: #fff;
    }
  }

  &.highlighted {
    background: lightskyblue;
    background: rgba(0, 0, 255, 0.2);
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    -o-transition: all 0.5s;
    transition: all 0.5s;
  }

  &.flashing {
    border: 1px solid red;
  }

  &.editable {
    z-index: 11;
    overflow: visible;
    background: white;
    border-color: black;
    border-style: solid;
  }

  &:focus {
    outline: none;
  }
}

.slick-selection {
  z-index: 10;
  position: absolute;
  border: 2px dashed black;
}


// Header Styles
.slick-header {
  border-bottom: 1px solid $slimgrid-border-color;
  background-color: $slimgrid-header-bg-color;

  &.ui-state-default {
    width: 100%;
    overflow: hidden;
    border-left: 0px;
  }
}

.slick-resizable-handle {
  position: absolute;
  font-size: 0.1px;
  display: block;
  cursor: col-resize;
  width: 4px;
  right: 0px;
  top: 0;
  height: 100%;
}

.slick-reorder-proxy {
  display: inline-block;
  background: blue;
  opacity: 0.15;
  filter: alpha(opacity = 15);
  cursor: move;
}

.slick-reorder-guide {
  display: inline-block;
  height: 2px;
  background: blue;
  opacity: 0.7;
  filter: alpha(opacity = 70);
}

.slick-header-column-sorted {
  font-style: italic;
}

.slick-header-column:hover > .slick-header-menubutton, 
.slick-header-column-active .slick-header-menubutton {
  display: inline-block;
}

.slick-header-column {

  .slick-header-menubutton {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    cursor: pointer;
    display: none;
    border-right: $slimgrid-border-color;
    border-left: 1px solid $slimgrid-border-color;
    width: $slimgrid-header-menubutton-width;
    background-image: none;
    background-color:  $slimgrid-header-bg-color;
  
    .caret {
      display: inline-block;
      width: 0;
      height: 0;
      margin-left: 0px;
      margin-top: 7px;
      vertical-align: middle;
      border-top: 4px dashed;
      border-right: 4px solid transparent;
      border-left: 4px solid transparent;
    }
  
    &.filtered {
      color: $slimgrid-header-menubutton-filtered-color;
    }
  }

  &.ui-state-default {
    height: 25px;
    line-height: 25px;
    border-right: 1px solid $slimgrid-border-color;
    position: relative;
    display: inline-block;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    margin: 0;
    padding: 4px;
    border-left: 0px;
    border-top: 0px;
    border-bottom: 0px;
    float: left;
  }

  .slick-sort-indicator-asc {
    margin-bottom: 8px;
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 3px;
    margin-top: 5px;
    vertical-align: middle;
    border-bottom: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    background-image: none;
    color: $slimgrid-sort-indicator-color;
  }

  .slick-sort-indicator-desc {
    margin-bottom: 5px;
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 3px;
    margin-top: 5px;
    vertical-align: middle;
    border-top: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    background-image: none;
    color: $slimgrid-sort-indicator-color;
  }
}

.slick-header-columns {
  position: relative;
  white-space: nowrap;
  cursor: default;
  overflow: hidden;
  text-align: center;
  margin: 0;
  padding: 0;
}

.slick-column-name, 
.slick-sort-indicator {
  /**
   * This makes all "float:right" elements after it that spill over to the next line
   * display way below the lower boundary of the column thus hiding them.
   */
  display: inline-block;
}

.slick-headerrow {
  background-color: #fff;

  &.ui-state-default {
    width: 100%;
    overflow: hidden;
    border-left: 0px;
  }
}

.slick-headerrow-columns {
  border-bottom: 1px solid $slimgrid-border-color;
  background-color: $slimgrid-headerrow-bg-color;
  position: relative;
  white-space: nowrap;
  cursor: default;
  overflow: hidden;
  text-align: center;
}

.slick-headerrow-column {
  position: absolute;
  border-right: 1px solid $slimgrid-border-color;
  border-left: 0px;
  border-top: 0px;
  border-bottom: 0px;
  overflow: hidden;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis;
  vertical-align: middle;
  z-index: 1;
  padding: 0px;
  margin: 0;
  white-space: nowrap;
  cursor: default;
  height: 100%;

  input {
    margin: 0;
    width: 100%;
    height: 100%;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    min-height: $slimgrid-headerrow-input-height;
    border: 1px solid transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-top: .2rem;
    padding-bottom: 0.2rem;
    padding-left: .5rem;
    padding-right: 0.5rem;
    color: $slimgrid-font-color;
  }
}

// Header-Menu Styles
.slick-header-menu {
  color: $slimgrid-font-color;
  font-size: $slimgrid-font-size;
  background: $slimgrid-header-bg-color;
  border: 1px solid $slimgrid-border-color;
  min-width: 175px;
  z-index: 100000;
  cursor: default;
  position: absolute;
  display: inline-block;
  margin: 0;
  padding: 4px !important;
  font-family: $slimgrid-font-family;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,0.10);
  border-bottom-right-radius: $slimgrid-border-radius;
  border-bottom-left-radius: $slimgrid-border-radius;

  label {
    font-weight: 400;
  }

  button {
    text-transform: none;
    overflow: visible;
    display: inline-block;
    margin: 2px;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: $slimgrid-font-size;
    line-height: 1.428571429;
    background-color: transparent;
    border: 1px solid transparent;
    color: $slimgrid-font-color;
    border-radius: .25rem;
    box-sizing: border-box;
    user-select: none;
    outline: 0;
    
    &:hover {
      color: $slimgrid-font-color;
      background-color: transparent;
      border-color: $slimgrid-border-color;
    }

    &:active:hover,
    &:active:focus,
    &:active.focus,
    &.active:hover,
    &.active:focus,
    &.active.focus {
      color: $slimgrid-font-color;
      background-color: transparent;
      border-color: $slimgrid-border-color;
    }
  }

  input.input {
    box-sizing: border-box;
    border: 1px solid $slimgrid-border-color;
    border-radius: .25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-left: .75rem;
    padding-right: .75rem;
    color: $slimgrid-font-color;
    padding-top: .5rem;
    padding-bottom: .5rem;
    width: 100%;
  }

  .filter {
    border: 1px solid $slimgrid-border-color;
    border-radius: .25rem;
    background: $slimgrid-bg-color;
    height: 200px;
    max-height: 200px;
    max-width: 300px;
    margin-top: 5px;
    margin-bottom: 5px;
    overflow: scroll;
    padding: 4px;
    white-space: nowrap;

    label {
      display: block;
      font-size: $slimgrid-font-size;
    }
  }
}

.slick-header-menuitem-disabled {
  color: silver;
}

.slick-header-menuitem {
  border: 1px solid transparent;
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: .25rem;
  cursor: pointer;
      
  .slick-header-menuicon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    background-repeat: no-repeat;
    background-position: center center;

    &.sort-asc {
      display: inline-block;
      width: 0;
      height: 0;
      margin-left: 8px;
      margin-top: 0px;
      vertical-align: middle;
      border-bottom: 4px dashed;
      border-right: 4px solid transparent;
      border-left: 4px solid transparent;
    }

    &.sort-desc {
      display: inline-block;
      width: 0;
      height: 0;
      margin-left: 8px;
      margin-top: 0px;
      vertical-align: middle;
      border-top: 4px dashed;
      border-right: 4px solid transparent;
      border-left: 4px solid transparent;    
    }
  }

  &:hover {
    border-color: $slimgrid-border-color;
  }
}

.slick-header-menucontent {
  display: inline-block;
  vertical-align: middle;
  margin: 5px;
  font-size: $slimgrid-font-size;
}


// Pager Styles
.slim-pager {
  font-family: $slimgrid-font-family;
  font-size: $slimgrid-font-size;
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: $slimgrid-pager-height;
  color: $slimgrid-font-color;
  font-size: $slimgrid-font-size;
  border: 1px solid $slimgrid-border-color;
  border-bottom-left-radius: $slimgrid-border-radius;
  border-bottom-right-radius: $slimgrid-border-radius;
  border-top: 0px;
  background: $slimgrid-pager-bg-color;

  div, span {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
  }

  .slim-pager-container {
    position: absolute;
  }

  .slim-pager-download {
    float: right;
    padding: $slimgrid-pager-padding !important;
    display: inline-block;

    .slim-pager-download-link {
      text-decoration: none;
      margin-right: 10px;
      color: $slimgrid-pager-download-link-font-color !important;
      cursor: pointer;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  .slim-pager-statistics {
    float: right;
    padding: $slimgrid-pager-padding !important;
    display: inline-block;

    .slim-pager-statistic {
      padding-right: 10px;
    }
  }
}

.slick-pager {
  vertical-align: middle;
  width: auto;
  border: none;
  background: none;
  height: $slimgrid-pager-height;
  margin-left: 10px;

  .slick-pager-nav {
    display: none;
  }

  .slick-pager-status,
  .slick-pager-loading,
  .slick-pager-download,
  .slick-pager-statistics,
  .slick-pager-settings {
    font-size: $slimgrid-font-size;
    padding: $slimgrid-pager-padding;
    display: inline-block;
  }

  .slick-pager-settings {
    float: right;

    * {
      vertical-align: middle;
    }

    a {
      padding: 2px;
      text-decoration: underline;
      cursor: pointer;
    }
  }
}


// Context Menu Styles
.slim-context-menu {
  position: absolute;
  margin: 0;
  color: $slimgrid-font-color;
  background: $slimgrid-context-menu-bg-color;
  border: 1px solid $slimgrid-context-menu-border-color;
  padding: 0px;
  display: inline-block;
  min-width: 130px;
  border-radius: .25rem;
  -moz-box-shadow: $slimgrid-context-menu-shadow;
  -webkit-box-shadow: $slimgrid-context-menu-shadow;
  z-index: 99999;
  font-size: $slimgrid-font-size;
  font-family: $slimgrid-font-family;

  .slim-context-menu-option {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    margin: .5rem;

    list-style: none;
    cursor: pointer;
    border-radius: .25rem;
    border: 1px solid transparent;

    &.disabled {
      cursor: default;
      color: $slimgrid-context-menu-opt-disabled-font-color;
      background-color: $slimgrid-context-menu-opt-disabled-bg-color;
    }

    &:hover {
      color: $slimgrid-font-color;
      border: $slimgrid-context-menu-opt-hover-border;
    }
  }
}
